package com.wingsboat;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author wangzhong
 * @description: TODO
 * @date 2024/7/20 10:45
 */
public class Test6 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        List<Node> nodes = new ArrayList<>();
        int[] heights = new int[num];
        int[] weights = new int[num];
        for(int i=0;i<num;i++){
            heights[i] = scanner.nextInt();
        }
        for(int i=0;i<num;i++){
            weights[i] = scanner.nextInt();
        }

        for (int i = 0; i < num; i++) {
            Node node = new Node(heights[i],weights[i],i+1);
            nodes.add(node);
        }
        nodes.sort(Node::compareTo);
        StringBuilder stringBuilder = new StringBuilder();
        for (Node node : nodes) {
            stringBuilder.append(node.getOrder() + " ");
        }
        System.out.println(stringBuilder.toString());
    }
}

class Node implements Comparable{

    private int height;

    private int weight;

    private int order;

    public Node(int height,int weight,int order){
        this.height = height;
        this.weight = weight;
        this.order = order;
    }

    @Override
    public int compareTo(Object o) {
        Node node = (Node) o;
        if(height>node.height){
            return 1;
        } else if (height<node.height) {
            return -1;
        } else {
            return weight>node.weight ? 1 : weight<node.weight ? -1 : 0;
        }
    }

    public int getOrder(){
        return order;
    }
}
